class Review < ActiveRecord::Base
  belongs_to :user
  belongs_to :movie
	
	#Add validation rules in review.rb to ensure the score is a number from 1 to 5
	validates_numericality_of :score
	validates_inclusion_of :score, :in => 1..5

	#make sure that any particular User can only create a single Review per movie 
	#(i.e. can't review the same movie twice)
	validates_uniqueness_of :user_id, :scope => :movie_id

end
